package cate.common.table.item;

import cate.common.table.ESheet;

public class ContinuePackSheet extends ESheet<ContinuePackRow> {
    @Override
    public String getSheetName() {
        return "礼包连开";
    }

    public ContinuePackRow findFirstPack(int itemTid){
        for(ContinuePackRow row : getList()){
            if(row.itemTid == itemTid && row.openTimes == 1){
                return row;
            }
        }
        return null;
    }

    public ContinuePackRow findNextPack(int id){
        ContinuePackRow now = get(id);
        if(now == null){
            return null;
        }
        for(ContinuePackRow row : getList()){
            if(row.itemTid == now.itemTid && row.openTimes == now.openTimes + 1){
                return row;
            }
        }
        return null;
    }
}
